
'use strict';

const Controller = require('egg').Controller;

class PurAgent extends Controller {
    async index() {
        const { ctx } = this;
        const { payload } = ctx.query
        console.log(payload);
        const obj = JSON.parse(payload)
        const data = await this.app.mysql.query(`SELECT * FROM secondhouses WHERE prov LIKE '%${obj.prov}%' and qs LIKE '%${obj.qs}%' and name LIKE '%${obj.name}%'  order by id asc`)
        ctx.body = {
            code: 200,
            data: data,
        };
    }
}

module.exports = PurAgent;